package dao;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;

import commande.Article;
import connexionsBdd.Postgresql;

public class DaoArticlePostgresql implements DaoArticle {
	private static final String SQL_INSERT = "INSERT INTO article (libelle,prixunitaire) VALUES(?,?);";

	@Override
	public Article get(int ref) throws Exception {
		
		
		return null;
	}

	@Override
	public ArrayList<Article> load(String libelle) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void save(Article article) throws SQLException {
		PreparedStatement req = Postgresql.getInstance().prepareStatement(SQL_INSERT);
		req.setString(1,article.getLibelle() );
		req.setDouble(2, article.getPrixUnitaire());
		req.execute();
		req.close();

	}

	@Override
	public void saveOrUpdate(Article article) {
		// TODO Auto-generated method stub

	}

	@Override
	public void remove(Article article) {
		// TODO Auto-generated method stub

	}

}
